package cn.yeyiu.netonlinevideo.fragment;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.LinearLayoutCompat;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

import cn.yeyiu.netonlinevideo.adapter.ListDataAdapter;
import cn.yeyiu.util.bean.MediaData;

/**
 * 只负责一种数据类型type的视频列表list
 * 根据接受的封装list 解封后进行渲染
 */

public class ListDataFragment extends DataFragment {

    ListDataAdapter adapter;

    public ListDataFragment(Context context){
        super(context);
        // rv
        adapter = new ListDataAdapter(mContext);
        rv.setAdapter(adapter);
        rv.setLayoutManager(new LinearLayoutManager(mContext));
    }

    @Override
    public void infoDataChange(List<MediaData> mediaDataList) {
        adapter.updateList(mediaDataList);
        changed();
    }
}
